package course.myra.testset;


public class Student implements Comparable<Student> {
	//属性
	private String stuName;
	private String StuNo;
	private  int stuScore;
	//方法
	@Override
	public int compareTo(Student o) {

		//比较器返回值为-1 0 1；
		if(this.getStuScore()>o.getStuScore()) {
			return 1;
		}else if(this.getStuScore()<o.getStuScore()) {
			return -1;
		}
		return 0;
	}
	
	
	
	
	
	@Override
	public String toString() {
		return "Student [stuName=" + stuName + ", StuNo=" + StuNo + ", stuScore=" + stuScore + "]";
	}





	public void printStuMes() {
		System.out.println("姓名："+stuName+" 学号："+StuNo+" 成绩："+stuScore);
	}
	//构造方法
	/**
	 * @param stuName 学生姓名
	 * @param stuNo 学生学号
	 * @param stuScore 学生成绩
	 */
	public Student(String stuName, String stuNo, int stuScore) {
		super();
		this.stuName = stuName;
		StuNo = stuNo;
		this.stuScore = stuScore;
	}
	//get& set
	public String getStuName() {
		return stuName;
	}
	public void setStuName(String stuName) {
		this.stuName = stuName;
	}
	public String getStuNo() {
		return StuNo;
	}
	public void setStuNo(String stuNo) {
		StuNo = stuNo;
	}
	public int getStuScore() {
		return stuScore;
	}
	public void setStuScore(int stuScore) {
		this.stuScore = stuScore;
	}
	
	

}
